
var last_click = -1;

function click_at(button){
    var day = parseInt(button.innerText)
    button.style.backgroundColor  = "#54FF9F"
    if(last_click != -1){
        last_click.style.backgroundColor = "transparent";
    }
    last_click = button

        $.ajax({
            type: "post",
            url: "/getRecords",
            data:{"day":day},
            dataType:"json",
            success:function (result){
                var content = document.getElementById("content")
                content.children[1].innerText = "未查询到内容"
                content.children[2].innerText = "未查询到内容"
                content.children[3].innerText = "未查询到内容"
                console.info(result.len)
                if(result.len == 0){

                    return ;
                }else{
                    content.children[1].innerText = result.sbTime
                    content.children[2].innerText = result.xbTime
                    if(result.isAbsent == 0)
                        content.children[3].innerText = "否"
                    else
                        content.children[3].innerText = "是"
                    for(var i = 0; i < content.length; i++)
                        console.info(content[i])
                }



            }
        })
}